<template>
	<view>
		<view class="none">
			<image src="../../static/image/none.png" mode="widthFix"></image>
			<view class="intr">
				您还没有咨询订单哦！
			</view>
			<view class="cent" v-if="!isLogin">
				<button class="mini-btn" type="default" size="mini" open-type="getUserInfo" @getuserinfo="getUserInfo">
					<image src="../../static/image/weixin.png" mode="widthFix"></image>
					<text>微信快捷登录</text>
				</button>
			</view>
			
			<view class="cons" v-else @tap="jumpConsult">
				我要咨询
			</view>
			
		</view>
	</view>
</template>

<script>
import { mapMutations,mapState } from "vuex"
export default {
	data() {
		return {
			
		}
	},
	computed:{
		...mapState({
			isLogin:state=>state.user.isLogin
		})
	},
	methods: {
		...mapMutations("user",["LOGIN"]),
		getUserInfo(value){
			if(value.detail.userInfo){
				this.LOGIN(true)
			}
		},
		jumpConsult(){
			uni.switchTab({
				url:"/pages/consult/consult"
			})
		}
	}
}
</script>

<style lang="scss" scoped>
.none{
	margin: 150rpx 0 0 0;
	text-align: center;
	image{
		width: 350rpx;
	}
	.intr{
		color: #666;
		font-size: 28rpx;
	}
	button{
		margin: 20px 0 0 0;
	}
}
.mini-btn{
	display: flex;
	align-items: center;
	border-radius: 50px;
	width: 280rpx;
	margin: 0 auto;
	color: #fff;
	justify-content: space-between;
	background-color: rgb(69,196,93);
	image{
		width: 50rpx;
		height: 50rpx;
		margin: 15rpx 0 15rpx 0;
	}
}
.cons{
	background-color: rgb(135,186,245);
	width: 230rpx;
	padding: 10rpx 0;
	color: #fff;
	margin: 20rpx auto;
	border-radius: 4px;
}
</style>
